package com.zhentao.controller;

import com.zhentao.bean.Result;
import com.zhentao.pojo.Classes;
import com.zhentao.pojo.Student;
import com.zhentao.service.ClassesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController//等于controller和ResponseBody
@RequestMapping("classes")
public class ClassesController {
    @Autowired
    private ClassesService classesService;
    //查询所有
    @RequestMapping("list")
    public Result list(){
        List<Classes> list= classesService.findAll();
        return Result.Ok("查询所有成功",list);
    }

}
